package com.itheima.dao;
import com.itheima.domain.Account;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

@Transactional
@Component
public interface AccountDao {
    @Select("select * from account where id = #{id} ")
    Account findByid(Integer id);
    @Insert("INSERT INTO account values(#{id},#{name},#{money})")
    void add(Account account);
    @Delete("delete from account where id=#{id}")
    void delete(Account account);
    @Update("update account set id=#{id},name=#{name},money=#{money} where id=#{id}")
    void update(Account account);
}
